-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds api_version property, adds 'Accept-Version' to headers #512
Adds api_version property, adds 'Accept-Version' to headers #512
Conversation
Codecov Report
@@ Coverage Diff @@
## master #512 +/- ##
=======================================
Coverage 97.85% 97.85%
=======================================
Files 71 71
Lines 7406 7409 +3
=======================================
+ Hits 7247 7250 +3
Misses 159 159
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brownj85!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Fix issue with single parameter list (#503) * Fix issue with single parameter list * Fix pyliny import complaint * Update changelog * removes unused variables in test_tdmprogram * Fix run_options not being used (#500) * Fix run_options not being used * Update changelog * Add tests * removes unused variables in test_tdmprogram (#504) Co-authored-by: Josh Izaac <josh146@gmail.com> * Add program code generator function (#496) * Add serialize function * Run black * Remove f * Updates from code review * Improve operations handling * Remove duplicate line * Fix generate_code + add tests * Tidy things up a bit * Add forgotten factor * Run black * Update changelog * Fixes from code review * Update strawberryfields/io.py Co-authored-by: Josh Izaac <josh146@gmail.com> * change argument name Co-authored-by: Josh Izaac <josh146@gmail.com> * Add wigner plotting (#495) * Add wigner plotting to program * Move plotting to plot module * Remove numpy import * Fixes after code-review * Tidy up wigner plotting * Run black * Add test * Update colours * Update changelog * rename tests * Update strawberryfields/plot.py Co-authored-by: antalszava <antalszava@gmail.com> * add contours arg * Update tests * Update changelog * Apply suggestions from code review Co-authored-by: antalszava <antalszava@gmail.com> * Remove url * fix string * fix arg name Co-authored-by: antalszava <antalszava@gmail.com> * Adds api_version property, adds 'Accept-Version' to headers (#512) * Fock state and quadrature plotting (#510) * Fock state plotting draft * Updates, error, test * test & imports * Test chart generation * Formatting * Remove unnecessary comment * Two-mode test * cutoff in test adjust * quad and adjust fock prev chart * Formatting * Adjust * quad test * generate_quad_chart test * Update tests/frontend/test_sf_plot.py * update * data always has two elements * reset Makefile * changelog, adjust chart title * ket latex render * latex in fock plot title * adjust tests for latex * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * adjust * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * marginal * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * docstring * adjust tests for Fock * quad tests * docstring * Move obtaining the Wigner function of the state to generate_wigner_chart * Docstring * add plot page * Update strawberryfields/plot.py Co-authored-by: Theodor <theodor@xanadu.ai> * base state render * docstring basestate render change Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: Theodor <theodor@xanadu.ai> * Fix bug in Dgate, Coherent, and DisplacedSqueezed (#507) * Support TF tensors in batch form Co-authored-by: Josh Izaac <josh146@gmail.com> * Add test * Add to changelog * Update PR in changelog * New line * Extend to other gates * Update changelog * Update * Update test * Update .github/CHANGELOG.md Co-authored-by: Josh Izaac <josh146@gmail.com> * Fix typo * Fix Co-authored-by: Josh Izaac <josh146@gmail.com> * Update tdm docstring (#519) * removes unused variables in test_tdmprogram * updates docstring * Implement OAuth refresh token flow (#520) * Implement OAuth refresh token flow * Apply suggestions from code review Formatting changes Co-authored-by: antalszava <antalszava@gmail.com> * Add correct token refresh path * update path, update getting the access token, remove url wrapping in _request * Formatting with black * move dict init into func * Updates * refresh access token unit tests * no print * User request.post directly, update tests * Wrapped request test, updates * Updates * Formatting * Remove access token refreshing from init * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update strawberryfields/api/connection.py Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com> * update msg in test * changelog Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Antal Szava <antalszava@example.com> Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com> * Increment version number to v0.17.0 (#523) * bump version and update changelog * update about * remove old current release * minor tweaks * dev bump (#524) * Update photonic_hardware.rst (#526) Co-authored-by: Theodor <theodor@xanadu.ai> Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Jack Brown <jack@xanadu.ai> Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> Co-authored-by: Tim Leisti <corvust@users.noreply.github.com> Co-authored-by: Antal Szava <antalszava@example.com> Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com>
* Fix issue with single parameter list (#503) * Fix issue with single parameter list * Fix pyliny import complaint * Update changelog * Fix run_options not being used (#500) * Fix run_options not being used * Update changelog * Add tests * removes unused variables in test_tdmprogram (#504) Co-authored-by: Josh Izaac <josh146@gmail.com> * Add program code generator function (#496) * Add serialize function * Run black * Remove f * Updates from code review * Improve operations handling * Remove duplicate line * Fix generate_code + add tests * Tidy things up a bit * Add forgotten factor * Run black * Update changelog * Fixes from code review * Update strawberryfields/io.py Co-authored-by: Josh Izaac <josh146@gmail.com> * change argument name Co-authored-by: Josh Izaac <josh146@gmail.com> * Add wigner plotting (#495) * Add wigner plotting to program * Move plotting to plot module * Remove numpy import * Fixes after code-review * Tidy up wigner plotting * Run black * Add test * Update colours * Update changelog * rename tests * Update strawberryfields/plot.py Co-authored-by: antalszava <antalszava@gmail.com> * add contours arg * Update tests * Update changelog * Apply suggestions from code review Co-authored-by: antalszava <antalszava@gmail.com> * Remove url * fix string * fix arg name Co-authored-by: antalszava <antalszava@gmail.com> * Adds api_version property, adds 'Accept-Version' to headers (#512) * Fock state and quadrature plotting (#510) * Fock state plotting draft * Updates, error, test * test & imports * Test chart generation * Formatting * Remove unnecessary comment * Two-mode test * cutoff in test adjust * quad and adjust fock prev chart * Formatting * Adjust * quad test * generate_quad_chart test * Update tests/frontend/test_sf_plot.py * update * data always has two elements * reset Makefile * changelog, adjust chart title * ket latex render * latex in fock plot title * adjust tests for latex * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * adjust * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * marginal * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update strawberryfields/plot.py Co-authored-by: Josh Izaac <josh146@gmail.com> * docstring * adjust tests for Fock * quad tests * docstring * Move obtaining the Wigner function of the state to generate_wigner_chart * Docstring * add plot page * Update strawberryfields/plot.py Co-authored-by: Theodor <theodor@xanadu.ai> * base state render * docstring basestate render change Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: Theodor <theodor@xanadu.ai> * Fix bug in Dgate, Coherent, and DisplacedSqueezed (#507) * Support TF tensors in batch form Co-authored-by: Josh Izaac <josh146@gmail.com> * Add test * Add to changelog * Update PR in changelog * New line * Extend to other gates * Update changelog * Update * Update test * Update .github/CHANGELOG.md Co-authored-by: Josh Izaac <josh146@gmail.com> * Fix typo * Fix Co-authored-by: Josh Izaac <josh146@gmail.com> * Update tdm docstring (#519) * removes unused variables in test_tdmprogram * updates docstring * Implement OAuth refresh token flow (#520) * Implement OAuth refresh token flow * Apply suggestions from code review Formatting changes Co-authored-by: antalszava <antalszava@gmail.com> * Add correct token refresh path * update path, update getting the access token, remove url wrapping in _request * Formatting with black * move dict init into func * Updates * refresh access token unit tests * no print * User request.post directly, update tests * Wrapped request test, updates * Updates * Formatting * Remove access token refreshing from init * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update tests/api/test_connection.py * Update strawberryfields/api/connection.py Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com> * update msg in test * changelog Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Antal Szava <antalszava@example.com> Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com> * Increment version number to v0.17.0 (#523) * bump version and update changelog * update about * remove old current release * minor tweaks * dev bump (#524) * Update photonic_hardware.rst (#526) * dummy change * Update strawberryfields/backends/bosonicbackend/backend.py Co-authored-by: Theodor <theodor@xanadu.ai> Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Jack Brown <jack@xanadu.ai> Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> Co-authored-by: Tim Leisti <corvust@users.noreply.github.com> Co-authored-by: Antal Szava <antalszava@example.com> Co-authored-by: Jeremy Swinarton <jeremy@swinarton.com>
Context:
The Xanadu platform API will soon be implementing versioning, allowing clients to
request a particular version of the API using the 'Accept-Version' HTTP header. This header will eventually be mandatory.
Description of the Change:
Adds an
api_version
str property toConnection
with the value1.0.0
. On init, adds'Accept-Version' header to
Connection._headers
with the value ofapi_version
.Benefits:
Future releases of sf will be able to use the platform API once versioning becomes
mandatory. Platform will be able to support older versions of sf following breaking
API changes.
Possible Drawbacks:
None, beyond the established drawbacks of versioning the platform API - older
releases of sf will eventually be incompatible with the platform once versioning
becomes mandatory. The current (non-versioned) platform API's behavior is
unchanged by the 'Accept-Version' header.
Related GitHub Issues: